package com.example.logistics_oa.controller;

import com.example.comment_oa.response.AjaxResponse;
import com.example.logistics_oa.service.JibenKaoqinhesuanService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/logisticsOa")
@CrossOrigin
public class JiBenKaoQinController {
    @Autowired
    JibenKaoqinhesuanService jibenKaoqinhesuanService;

    @PostMapping("/updateOnepersonKaoQin/{jibenZhujian}")
    public AjaxResponse updateOnepersonKaoQin(@PathVariable("jibenZhujian")int jibenZhujian){
        int i = jibenKaoqinhesuanService.updateKaoQinOnePerson(jibenZhujian);
        return AjaxResponse.success();
    }

    @PostMapping("/updateAllKaoqin/{jibenId}")
    public AjaxResponse updateAllKaoqin(@PathVariable("jibenId")String jibenId){
        int i = jibenKaoqinhesuanService.updateAllKaoqin(jibenId);
        return AjaxResponse.success();
    }
}
